﻿using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.Xpo;

namespace Component
{
    public class ColorDB:Base
    {
        public static XPCollection<Colors> GetAll(bool admin)
        {
            XPCollection<Colors> _xp = new XPCollection<Colors>(KetNoiCSDL.session);
            _xp.Filter = FilterAll(admin);
            return _xp;
        }

        public static Colors GetObjectById(int id, bool admin)
        {
            XPCollection<Colors> _xp = new XPCollection<Colors>(KetNoiCSDL.session);
            _xp.Filter = FilterById(id, admin);
            try
            {
                return _xp[0];
            }
            catch
            { return new Colors(KetNoiCSDL.session); }
        }
    }
}
